Required bean name is "Bt31".
Some examples of typical usage of this bean are the following:
(1)
The direction of the bean is set to input.
MAIN.C
void main(void)
{
/* Wait until "10101010" is on the low port,
"01010101" is on the middle port and
"00010001" is on the high port */
while( Bt31_GetVal() != 0x1155AA );
:
}
(2)
The direction of the bean is set to output.
MAIN.C
void main(void)
{
Bt31_PutVal(0x1155AA);
/* "10101010" is on the low port,
"01010101" is on the middle port and
"00010001" is on the high port */
for (;;) {
/* Invert output level of second pin on the high port */
Bt31_NegBit(17);
}
}
(3)
The direction of the bean is set to input/output.
MAIN.C
void main(void)
{
Bt31_SetDir(FALSE); // Set input mode
/* Wait until "0xFFFFFF" is on the ports */
while( Bt31_GetVal() != 0xFFFFFF );
Bt31_SetDir(TRUE); // Set output mode
Bt31_PutVal(0); // Set "0x000000" on the ports
}
For more about typical usage of the bean code please refer to the page Bean Code Typical Usage.